
#include "common/runtime/Hash.hpp"
#include "vectorwise/Operations.hpp"
#include "vectorwise/Primitives.hpp"
#include <functional>

using namespace types;
using namespace std;

namespace vectorwise {
namespace primitives {

#define MK_PARTITION(type)                                                     \
   FPartitionByKey partition_by_key_##type##_col =                             \
       (FPartitionByKey)&partition_by_key<type>;
#define MK_PARTITION_SEL(type)                                                 \
   FPartitionByKeySel partition_by_key_sel_##type##_col =                      \
       (FPartitionByKeySel)&partition_by_key_sel<type>;
#define MK_PARTITION_ROW(type)                                                 \
   FPartitionByKeyRow partition_by_key_row_##type##_col =                      \
       (FPartitionByKeyRow)&partition_by_key_row<type>;

//EACH_TYPE(NIL, MK_PARTITION)
FPartitionByKey partition_by_key_Date_col =
    (FPartitionByKey)&partition_by_key<Date>;
FPartitionByKey partition_by_key_Char_1_col =
    (FPartitionByKey)&partition_by_key<Char_1>;
FPartitionByKey partition_by_key_Char_6_col =
    (FPartitionByKey)&partition_by_key<Char_6>;
FPartitionByKey partition_by_key_Char_7_col =
    (FPartitionByKey)&partition_by_key<Char_7>;
FPartitionByKey partition_by_key_Char_9_col =
    (FPartitionByKey)&partition_by_key<Char_9>;
FPartitionByKey partition_by_key_Char_10_col =
    (FPartitionByKey)&partition_by_key<Char_10>;
FPartitionByKey partition_by_key_Char_12_col =
    (FPartitionByKey)&partition_by_key<Char_12>;
FPartitionByKey partition_by_key_Char_15_col =
    (FPartitionByKey)&partition_by_key<Char_15>;
FPartitionByKey partition_by_key_Char_25_col =
    (FPartitionByKey)&partition_by_key<Char_25>;
FPartitionByKey partition_by_key_hash_t_col =
    (FPartitionByKey)&partition_by_key<hash_t>;
FPartitionByKey partition_by_key_int32_t_col =
    (FPartitionByKey)&partition_by_key<int32_t>;
FPartitionByKey partition_by_key_int64_t_col =
    (FPartitionByKey)&partition_by_key<int64_t>;
FPartitionByKey partition_by_key_int8_t_col =
    (FPartitionByKey)&partition_by_key<int8_t>;
FPartitionByKey partition_by_key_int16_t_col =
    (FPartitionByKey)&partition_by_key<int16_t>;

//EACH_TYPE(NIL, MK_PARTITION_SEL)
FPartitionByKeySel partition_by_key_sel_Date_col =
    (FPartitionByKeySel)&partition_by_key_sel<Date>;
FPartitionByKeySel partition_by_key_sel_Char_1_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_1>;
FPartitionByKeySel partition_by_key_sel_Char_6_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_6>;
FPartitionByKeySel partition_by_key_sel_Char_7_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_7>;
FPartitionByKeySel partition_by_key_sel_Char_9_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_9>;
FPartitionByKeySel partition_by_key_sel_Char_10_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_10>;
FPartitionByKeySel partition_by_key_sel_Char_12_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_12>;
FPartitionByKeySel partition_by_key_sel_Char_15_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_15>;
FPartitionByKeySel partition_by_key_sel_Char_25_col =
    (FPartitionByKeySel)&partition_by_key_sel<Char_25>;
FPartitionByKeySel partition_by_key_sel_hash_t_col =
    (FPartitionByKeySel)&partition_by_key_sel<hash_t>;
FPartitionByKeySel partition_by_key_sel_int32_t_col =
    (FPartitionByKeySel)&partition_by_key_sel<int32_t>;
FPartitionByKeySel partition_by_key_sel_int64_t_col =
    (FPartitionByKeySel)&partition_by_key_sel<int64_t>;
FPartitionByKeySel partition_by_key_sel_int8_t_col =
    (FPartitionByKeySel)&partition_by_key_sel<int8_t>;
FPartitionByKeySel partition_by_key_sel_int16_t_col =
    (FPartitionByKeySel)&partition_by_key_sel<int16_t>;

//EACH_TYPE(NIL, MK_PARTITION_ROW)
FPartitionByKeyRow partition_by_key_row_Date_col =
    (FPartitionByKeyRow)&partition_by_key_row<Date>;
FPartitionByKeyRow partition_by_key_row_Char_1_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_1>;
FPartitionByKeyRow partition_by_key_row_Char_6_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_6>;
FPartitionByKeyRow partition_by_key_row_Char_7_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_7>;
FPartitionByKeyRow partition_by_key_row_Char_9_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_9>;
FPartitionByKeyRow partition_by_key_row_Char_10_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_10>;
FPartitionByKeyRow partition_by_key_row_Char_12_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_12>;
FPartitionByKeyRow partition_by_key_row_Char_15_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_15>;
FPartitionByKeyRow partition_by_key_row_Char_25_col =
    (FPartitionByKeyRow)&partition_by_key_row<Char_25>;
FPartitionByKeyRow partition_by_key_row_hash_t_col =
    (FPartitionByKeyRow)&partition_by_key_row<hash_t>;
FPartitionByKeyRow partition_by_key_row_int32_t_col =
    (FPartitionByKeyRow)&partition_by_key_row<int32_t>;
FPartitionByKeyRow partition_by_key_row_int64_t_col =
    (FPartitionByKeyRow)&partition_by_key_row<int64_t>;
FPartitionByKeyRow partition_by_key_row_int8_t_col =
    (FPartitionByKeyRow)&partition_by_key_row<int8_t>;
FPartitionByKeyRow partition_by_key_row_int16_t_col =
    (FPartitionByKeyRow)&partition_by_key_row<int16_t>;
}
}
